#pragma once

#include "ZNetworkMessage.h"

namespace	Z	{

//------------------------------------------------------------------------------------------------------------------------
class	Stream;

//------------------------------------------------------------------------------------------------------------------------
class	_ZNetworkApi	NetworkGenericMessage
	:	public NetworkMessage
{
public:
	NetworkGenericMessage(NetworkId kNetworkId, size_t kSize);
	virtual	~NetworkGenericMessage();
	virtual	void	pump(MessageHandler& kMessageHandler);
	virtual	byte_t*	data()	const;
	virtual	size_t	size()	const;
	void	write(const void* data, size_t kSize);
	byte_t*	getBuffer()	const;
	void	onWritten(size_t kSize);
	Stream*	detach();

private:
	Stream*	mStream;
};

}